[Asp.Net MVC] Encoding a character
Posted
by Trimack
on Stack Overflow
See other posts from Stack Overflow
or by Trimack
Published on 2010-06-18T14:38:01Z
Indexed on
2010/06/18
14:53 UTC
Read the original article
Hit count: 399
Hi, I am experiencing some weird encoding behaviour in my ASP.NET MVC project.
In my Site.Master there is
<div class="logo">
<a href="<%=Url.Action("Index", "Win7")%>"><%= Html.Encode("Windows 7 Tutoriál") %></a></div>
which translates to the resulting page as
<div class="logo">
<a href="/">Windows 7 TutoriA?l</a></div>
However, in the Index.aspx there is
<h1>
Windows 7 Tutoriál</h1>
which translates correctly on the same resulting page. I do have
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
as my first line in <head>
. Locally, both files are saved in UTF-8 encoding.
Any ideas why is this happening and how to fix it?
Thanks in advance.
© Stack Overflow or respective owner